package de.slothsoft.commons.swing;

import javax.swing.JProgressBar;

public class ProgressBarMonitor implements IProgressMonitor {

	private JProgressBar bar;

	public ProgressBarMonitor(JProgressBar bar) {
		this.bar = bar;
	}

	@Override
	public void setMaximum(int value) {
		this.bar.setMaximum(value);
	}

	@Override
	public void clearProgress() {
		this.bar.setValue(0);
	}

	@Override
	public void incrementProgress(int value) {
		this.bar.setValue(this.bar.getValue() + value);
	}

}
